package org.example.ddl;

import org.zoomdev.zoom.dao.ddl.SqlType;
import org.zoomdev.zoom.dao.ddl._DDL_Column;
import org.zoomdev.zoom.dao.ddl._DDL_Primary;
import org.zoomdev.zoom.dao.ddl._DDL_Table;
import org.zoomdev.zoom.dao.driver.MysqlDriver;

@_DDL_Table(name = "all_types_table", simpleName = "", engine = MysqlDriver.InnoDB, comment = "包含所有MySQL数据类型的测试表")
public class _DDL_AllTypesTable {

    @_DDL_Primary()
    @_DDL_Column(name = "id", type = SqlType.BIGINT, notNull = true, autoIncrement = true, comment = "主键ID")
    private Long id;

    @_DDL_Column(name = "tinyint_col", type = SqlType.TINYINT, comment = "小整数 [-128, 127]")
    private Integer tinyintCol;

    @_DDL_Column(name = "smallint_col", type = SqlType.SMALLINT, comment = "短整数 [-32768, 32767]")
    private Integer smallintCol;

    @_DDL_Column(name = "mediumint_col", type = SqlType.MEDIUMINT, comment = "中等整数 [-8388608, 8388607]")
    private Integer mediumintCol;

    @_DDL_Column(name = "int_col", type = SqlType.INT, comment = "整数 [-2147483648, 2147483647]")
    private Integer intCol;

    @_DDL_Column(name = "bigint_col", type = SqlType.BIGINT, comment = "大整数 [-2^63, 2^63-1]")
    private Long bigintCol;

    @_DDL_Column(name = "float_col", type = SqlType.FLOAT, size = 10, scale = 4, comment = "单精度浮点")
    private Float floatCol;

    @_DDL_Column(name = "double_col", type = SqlType.DOUBLE, size = 15, scale = 8, comment = "双精度浮点")
    private Double doubleCol;

    @_DDL_Column(name = "decimal_col", type = SqlType.DECIMAL, size = 20, scale = 10, comment = "定点数")
    private java.math.BigDecimal decimalCol;

    @_DDL_Column(name = "date_col", type = SqlType.DATE, comment = "日期")
    private java.sql.Date dateCol;

    @_DDL_Column(name = "time_col", type = SqlType.TIME, comment = "时间")
    private java.sql.Time timeCol;

    @_DDL_Column(name = "datetime_col", type = SqlType.DATETIME, comment = "日期时间")
    private java.time.LocalDateTime datetimeCol;

    @_DDL_Column(name = "timestamp_col", type = SqlType.TIMESTAMP, defaultValue = MysqlDriver.CURRENT_TIMESTAMP_ON_UPDATE, comment = "时间戳")
    private java.sql.Timestamp timestampCol;

    @_DDL_Column(name = "year_col", type = SqlType.YEAR, comment = "年份")
    private java.sql.Date yearCol;

    @_DDL_Column(name = "char_col", type = SqlType.CHAR, size = 10, comment = "定长字符串")
    private String charCol;

    @_DDL_Column(name = "varchar_col", type = SqlType.VARCHAR, size = 255, comment = "变长字符串")
    private String varcharCol;

    @_DDL_Column(name = "binary_col", type = SqlType.BINARY, size = 16, comment = "定长二进制")
    private byte[] binaryCol;

    @_DDL_Column(name = "varbinary_col", type = SqlType.VARBINARY, size = 255, comment = "变长二进制")
    private byte[] varbinaryCol;

    @_DDL_Column(name = "tinytext_col", type = SqlType.TINYTEXT, comment = "小文本")
    private String tinytextCol;

    @_DDL_Column(name = "text_col", type = SqlType.TEXT, comment = "文本")
    private String textCol;

    @_DDL_Column(name = "mediumtext_col", type = SqlType.MEDIUMTEXT, comment = "中等文本")
    private String mediumtextCol;

    @_DDL_Column(name = "longtext_col", type = SqlType.LONGTEXT, comment = "长文本")
    private String longtextCol;

    @_DDL_Column(name = "tinyblob_col", type = SqlType.TINYBLOB, comment = "小二进制")
    private byte[] tinyblobCol;

    @_DDL_Column(name = "blob_col", type = SqlType.BLOB, comment = "二进制数据")
    private byte[] blobCol;

    @_DDL_Column(name = "mediumblob_col", type = SqlType.MEDIUMBLOB, comment = "中等二进制")
    private byte[] mediumblobCol;

    @_DDL_Column(name = "longblob_col", type = SqlType.LONGBLOB, comment = "长二进制")
    private byte[] longblobCol;

    @_DDL_Column(name = "json_col", type = SqlType.JSON, comment = "JSON数据")
    private String jsonCol;

    @_DDL_Column(name = "enum_col", type = SqlType.ENUM, values = {"RED", "GREEN", "BLUE"}, comment = "枚举值")
    private String enumCol;

    @_DDL_Column(name = "set_col", type = SqlType.SET, values = {"READ", "WRITE", "DELETE"}, comment = "集合值")
    private String setCol;

    @_DDL_Column(name = "boolean_col", type = SqlType.BOOLEAN, comment = "布尔值")
    private Boolean booleanCol;

}
